<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Adminlog Controller
 * Build by Phuc Nguyen
 * Contact : nguyenvanphuc0626@gmail.com
 */

class Salesphone_model extends MY_Model{
	
	public function __construct(){
		parent::__construct();
		$this->table_name = 'book_sales_phone';
	}
                
        public function updatePhoneActive($params){
                $sql    = "UPDATE {$this->table_name} SET status = 1,waiting = 0 WHERE phone = '".$params."'";
                $this->db->query($sql);
                return $this->db->affected_rows();
        }
        
        public function existsphone($params){
                $this->db->select('phone');
		$this->db->from($this->table_name);
                $this->db->like('phone',$params);
                $query = $this->db->get();
		return $query->result();
        }
}